import type { IUserOv } from '@/interfaces';
import { formatCount } from '@/lib/tool';

export default function StatisticsUserIdH5Page({
  user,
}: {
  user: IUserOv | undefined;
}) {
  return (
    <div className="row row-cols-1 g-4">
      <div className="col">
        <div className="card rounded-5">
          <div className="card-body">
            <div className="mb-1">
              <i className="bi bi-bar-chart fs-5"></i>
            </div>
            <p className="card-text">
              内容数&nbsp;{formatCount(user ? user.statistic.sections : 0)}
            </p>
          </div>
        </div>
      </div>

      <div className="col">
        <div className="card rounded-5">
          <div className="card-body">
            <div className="mb-1">
              <i className="bi bi-bar-chart fs-5"></i>
            </div>
            <p className="card-text">
              标签数&nbsp;{formatCount(user ? user.statistic.tags : 0)}
            </p>
          </div>
        </div>
      </div>

      <div className="col">
        <div className="card rounded-5">
          <div className="card-body">
            <div className="mb-1">
              <i className="bi bi-bar-chart fs-5"></i>
            </div>
            <p className="card-text">
              帖子数&nbsp;{formatCount(user ? user.statistic.posts : 0)}
            </p>
          </div>
        </div>
      </div>

      <div className="col">
        <div className="card rounded-5">
          <div className="card-body">
            <div className="mb-1">
              <i className="bi bi-bar-chart fs-5"></i>
            </div>
            <p className="card-text">
              评论数&nbsp;{formatCount(user ? user.statistic.comments : 0)}
            </p>
          </div>
        </div>
      </div>

      <div className="col">
        <div className="card rounded-5">
          <div className="card-body">
            <div className="mb-1">
              <i className="bi bi-bar-chart fs-5"></i>
            </div>
            <p className="card-text">
              回复数&nbsp;{formatCount(user ? user.statistic.replies : 0)}
            </p>
          </div>
        </div>
      </div>

      <div className="col">
        <div className="card rounded-5">
          <div className="card-body">
            <div className="mb-1">
              <i className="bi bi-bar-chart fs-5"></i>
            </div>
            <p className="card-text">
              浏览数&nbsp;{formatCount(user ? user.statistic.views : 0)}
            </p>
          </div>
        </div>
      </div>
    </div>
  );
}
